home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / signal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-05  |  1.6 KB  |  76 lines  |  [TEXT/MPS ]

  1. /*
  2.     Signal.h -- Signal handling
  3.     
  4.     Copyright Apple Computer,Inc.    1988, 1990, 1995
  5.     All rights reserved.
  6.  
  7. */
  8.  
  9. #ifndef __SIGNAL__
  10. #define __SIGNAL__
  11.  
  12. /* Conditional Macros:
  13.  *    UsingStaticLibs    - for CFM-68K:  Insures that #pragma import is never used.
  14.  *    <none>            - for CFM-68K:    Insures that all functions and data items are
  15.  *                                    marked as library imports
  16.  */
  17.  
  18.  
  19. typedef int sig_atomic_t;
  20.  
  21.  
  22. /*
  23.  *    Special signal handlers, compatible with the second argument to signal()
  24.  *    or, in the case of SIG_ERR, the return value from signal().
  25.  */
  26.  
  27. #define SIG_DFL ((void (*)(int)) 1)
  28. #define SIG_ERR ((void (*)(int)) -1)
  29. #define SIG_IGN ((void (*)(int)) 0)
  30. #define SIG_HOLD ((void (*)(int)) 3)
  31. #define SIG_RELEASE ((void (*)(int)) 5)
  32.  
  33.  
  34. /*
  35.  *    Signal numbers for specific conditions.
  36.  */
  37.  
  38. #define SIGABRT        (1<<0)    /* Abnormal termination e.g. by the abort() function */
  39. #define SIGFPE        (1<<2)    /* Arithmetic exception -- not currently implemented */
  40. #define SIGILL        (1<<3)    /* Illegal instruction -- not currently implemented */
  41. #define SIGINT        (1<<1)    /* Interactive attention signal -- User interrupt via CMD-. */
  42. #define SIGSEGV        (1<<4)    /* Segmentation violation -- not currently implemented */
  43. #define SIGTERM        (1<<5)    /* Termination request -- not currently implemented */
  44.  
  45.  
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. #if defined (__CFM68K__) && !defined (UsingStaticLibs)
  51.     #pragma import on
  52. #endif
  53.  
  54. /*
  55.  *    Specify a signal handling function.
  56.  */
  57.  
  58. void (*signal (int sig, void (*func) (int))) (int);
  59.  
  60.  
  61. /*
  62.  *    Send a signal.
  63.  */
  64.  
  65. int raise (int sig);
  66.  
  67. #if defined (__CFM68K__) && !defined (UsingStaticLibs)
  68.     #pragma import off
  69. #endif
  70.  
  71. #ifdef __cplusplus
  72. }
  73. #endif
  74.  
  75. #endif
  76.